import request from '@/utils/request'

// 查询充电枪列表
export function listChargerGun(query) {
  return request({
    url: '/charge/chargerGun/list',
    method: 'get',
    params: query
  })
}

// 查询充电枪详细
export function getChargerGun(id) {
  return request({
    url: '/charge/chargerGun/' + id,
    method: 'get'
  })
}

// 新增充电枪
export function addChargerGun(data) {
  return request({
    url: '/charge/chargerGun',
    method: 'post',
    data: data
  })
}

// 修改充电枪
export function updateChargerGun(data) {
  return request({
    url: '/charge/chargerGun',
    method: 'put',
    data: data
  })
}

// 删除充电枪
export function delChargerGun(ids) {
  return request({
    url: '/charge/chargerGun/' + ids,
    method: 'delete'
  })
}

// 插枪
export function insertGun(id, gunId) {
  return request({
    url: '/core/insertGun',
    method: 'post',
    data: { id, gunId }
  })
}

// 拔枪
export function removeGun(id, gunId) {
  return request({
    url: '/core/removeGun',
    method: 'post',
    data: { id, gunId }
  })
}